package demo.practice.competition;

import java.util.Arrays;

public class P5801 {

    public static void main(String[] args) {
        P5801 p5801 = new P5801();
        p5801.eliminateMaximum(new int[]{1,1,2,3}, new int[]{1,1,1,1});
    }

    public int eliminateMaximum(int[] dist, int[] speed) {

        int[] times = new int[dist.length];
        for (int i = 0; i < dist.length; i++) {
            times[i] =dist[i] % speed[i]==0?   dist[i] / speed[i] : dist[i] / speed[i]+1;
        }

        Arrays.sort(times);
        //System.out.println("xx");
        int res = 0;


        for (int i = 0; i < times.length; i++) {
            if (times[i] > i)
                res += 1;
            else
                break;
        }

        return res;
    }
}
